package com.yangquan.ayuan.creatThread;

public class RunnableThreadExample implements Runnable {
    @Override
    public void run() {
        System.out.println("子线程开始执行任务。");
    }
}

class App_2 {
    public static void main(String[] args) {
        // 1. 创建一个 Runnable 对象
        Runnable runnable = new ThreadExample();
        // 2. 将 Runnable对象传入 Thread
        Thread thread = new Thread(runnable);
        // 3. 调用线程的 start() 方法来异步执行线程
        thread.start();
    }
}